package com.zerui.manager.access.auth.task.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zerui.manager.access.auth.task.domain.AuthTaskDetail;
import com.zerui.manager.access.auth.task.entity.AccessAuthTaskDetailDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AccessAuthTaskDetailMapper extends BaseMapper<AccessAuthTaskDetailDO> {

    @Select({"<script>",
            "SELECT taatd.id,taatd.access_auth_id,taatd.task_id,taatd.device_id,taatd.personnel_id,taatd.operate,taatd.sync_status,taatd.create_time,taatd.update_time,taatd.request_id,taatd.response_data,taatd.retry_times"
                    + ",taad.device_from"
                    + " FROM tb_access_auth_task_detail taatd "
                    + " LEFT JOIN tb_access_auth_device taad on taatd.device_id = taad.device_id"
                    + " WHERE taatd.task_id = #{taskId}",
            "</script>"})
    List<AuthTaskDetail> selectListByTaskId(@Param("taskId") Long taskId);
}
